Skip to content

Conversation

@PeterFokkinga
Copy link

@PeterFokkinga PeterFokkinga commented Aug 23, 2018

useful when the property contains JSON data, for example a serialized object like a Map; it saves you the trouble create a pipeline with a JSON processor in Elastic

example:

<property>
 <name>params</name>
 <value>%mdc{httpParameters}</value>
 <type>object</type>
 <allowEmpty>false</allowEmpty>
</property>

with the following in a Filter or Servlet
MDC.put("httpParameters", new GsonBuilder().create().toJson(request.getParameterMap()));

useful when the property contains JSON data, for example a serialized object like a Map; it saves you the trouble create a pipeline with a JSON processor in Elastic

example:
<property>
 <name>params</name>
 <value>%mdc{httpParameters}</value>
 <type>object</type>
 <allowEmpty>false</allowEmpty>
</property>

with the following in a Filter or Servlet
MDC.put("httpParameters", new GsonBuilder().create().toJson(request.getParameterMap()));
cgoIT added a commit to cgoIT/logback-elasticsearch-appender that referenced this pull request Jun 22, 2020
btsweber pushed a commit to SeaStreetTechnologies/logback-elasticsearch-appender that referenced this pull request Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant